function GetApplication() {

	var myData = [
			['1', '系统1', "oa系统", "192.168.0.1"],
			['2', '系统2', "erp系统", "192.168.0.2"],
			['3', '系统3', "mysql数据库", "192.168.0.3"],
			['4', '系统4', "邮件系统", "子网1"],
			['5', '系统5', "oa系统", "子网2"]

	];


	var store = new Ext.data.ArrayStore({
				fields : [{
							name : 'id'
						}, {
							name : 'name'
						}, {
							name : 'depict'
						}, {
							name : 'addr'
						}]
			});
			
	store.loadData(myData);
	
	var sm = new Ext.grid.CheckboxSelectionModel();
	var grid = new Ext.grid.GridPanel({
				store : store,
				columns : [sm, {
							id : 'id',
							header : 'id',
							width : 10,
							sortable : true,
							dataIndex : 'id',
							hidden : true
						}, {
							header : '名称',
							width : 70,
							sortable : true,
							dataIndex : 'name'
						}, {
							header : '描述',
							width : 70,
							sortable : true,
							dataIndex : 'depict'
						}, {
							header : '地址',
							width : 150,
							sortable : true,
							dataIndex : 'addr'
						}],
				sm : sm,
				tbar : [{
				            text:'添加',
				            tooltip : '添加',
				            iconCls: 'add', 
							handler : function() {
								SetApplication(subnetReturn);
							}
				        },'-',{
							text : '编辑',
							tooltip : '编辑',
							iconCls : 'modify',
							handler : function() {
								SetApplication(subnetReturn);
							}
						}, '-', {
							text : '删除',
							tooltip : '删除',
							iconCls : 'delete',
							ref : '../removeBtn',
							disabled : true,
							handler : function() {
								var s = grid.getSelectionModel().getSelections();
								for (var i = 0; r = s[i]; i++) {
									store.remove(r);
								}
							}
						}, '-', {
							text : '刷新',
							tooltip : '刷新',
							iconCls : 'refresh',
							handler : function() {							
								store.loadData(myData);
							}
						}],
				
				stripeRows : true,
				autoExpandColumn : 'id',
				stateful : true,
				stateId : 'grid'
			});
	grid.getSelectionModel().on('selectionchange', function(sm) {
				grid.removeBtn.setDisabled(sm.getCount() < 1);
			});

	function subnetReturn(data){
		var jsondata = Ext.util.JSON.decode(data);
		
	}

	function reflashgriad(page) {
	}
	
	
	
	return grid;
}


function SetApplication(subnetReturn){

	var myData = [
			['1', '研发组子网', "研发组使用", "192.168.0.1", '255.255.255.0'],
			['2', '研发组子网', "研发组使用", "192.168.0.1", '255.255.255.0'],
			['3', '研发组子网', "研发组使用", "192.168.0.1", '255.255.255.0'],
			['4', '研发组子网', "研发组使用", "192.168.0.1", '255.255.255.0'],
			['5', '研发组子网', "研发组使用", "192.168.0.1", '255.255.255.0']

	];


	var store = new Ext.data.ArrayStore({
				fields : [{
							name : 'id'
						}, {
							name : 'name'
						}, {
							name : 'depict'
						}, {
							name : 'start_ip'
						}, {
							name : 'end_ip'
						}]
			});
			
	store.loadData(myData);
	
	var sm = new Ext.grid.CheckboxSelectionModel();
	var grid = new Ext.grid.GridPanel({
				store : store,
				columns : [sm, {
							id : 'id',
							header : 'id',
							width : 10,
							sortable : true,
							dataIndex : 'id',
							hidden : true
						}, {
							header : '网段名称',
							width : 150,
							sortable : true,
							dataIndex : 'name'
						}, {
							header : '描述',
							width : 70,
							sortable : true,
							dataIndex : 'depict'
						}, {
							header : 'IP',
							width : 70,
							sortable : true,
							dataIndex : 'start_ip'
						}, {
							header : '掩码',
							width : 150,
							sortable : true,
							dataIndex : 'end_ip'
						}],
				sm : sm,
				
				stripeRows : true,
				autoExpandColumn : 'id',
				stateful : true,
				height:150,
				stateId : 'grid'
			});

	var subnet_center = {
		xtype: 'fieldset',
		margins:'5 5 5 5',
		layout : 'form',
		region:'center',
		bodyStyle : 'padding:10px;',
		items: [
		{
			xtype: 'textfield',
			name: 'name',
			id  : 'name',
			fieldLabel: '应用系统名称',
			anchor: '100%'
		},{
			xtype: 'textarea',
			name: 'depict',
			id  : 'depict',
			fieldLabel: '描述',
			anchor: '100%'
		},{
		            xtype:'fieldset',
		            checkboxToggle:true,
		            title: 'IP地址',
		            id:'type1',
		            autoHeight:true,
		            collapsed: false,
		            items :[
		            	{
										xtype: 'textfield',
										name: 'ip',
										id  : 'ip',
										fieldLabel: 'IP',
										anchor: '100%'
									}
		            ],
		            listeners:{'collapse':function(obj){
                        Ext.getCmp('type2').expand();     
                        },
                        'expand':function(obj){
                        Ext.getCmp('type2').collapse(true); 
                        }
                    }
		        },{
		            xtype:'fieldset',
		            checkboxToggle:true,
		            title: '子网',
		            id:'type2',
		            height:150,
		            collapsed: true,
		            items :[
		            	grid
		            ],
		            listeners:{'collapse':function(obj){
                        Ext.getCmp('type1').expand();     
                        },
                        'expand':function(obj){
                        Ext.getCmp('type1').collapse(true); 
                        }
                    }
		        }
	
		]
	};

	var subnetWindows = new Ext.Window({
				layout : 'border',
				width : 600,
				height : 420,
				title : "添加应用系统",
				modal : true,
				resizable : true,
				maximizable : true,
				iconCls : 'subnet',
				items : [subnet_center],
				plain : true
				
			});
	subnetWindows.addButton({
				text : "确定",
				handler : function() {
					var data = "{name:'" + Ext.get("name").getValue() + "',depict:'" + Ext.get("depict").getValue() + "',start_ip:'" + Ext.get("start_ip").getValue() + "',end_ip:'" + Ext.get("end_ip").getValue() + "'}";
					subnetReturn(data);
					subnetWindows.close();
				}
			});
	subnetWindows.addButton({
				text : '取 消',
				handler : function() {
					subnetWindows.close();
				}
			});
	subnetWindows.show();

}
	